package com.xxx.exception.advice;

import com.xxx.common.Result;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class CommonExceptionHandler {
//    @ExceptionHandler(RuntimeException.class)
//    public Result doRuntimeException(RuntimeException e){
//        System.out.println("RuntimeException 异常触发了");
//        if (e instanceof AccessDeniedException
//                || e instanceof AuthenticationException) {
//            throw e;
//        }
//        return Result.error(e.getMessage());
//    }
}
